

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Cheney">
  <meta name="keywords" content="Coding">
  
    <meta name="description" content="用汇编语言编写一小段程序，如在屏幕上输出一个字符。（调用中断）增加键盘中断，可以对键盘上的动作进行响应（如敲入某字符X，屏幕能回显即可）。">
<meta property="og:type" content="article">
<meta property="og:title" content="自制简单U盘引导程序.md">
<meta property="og:url" content="https://cheney822.gitee.io/2021/05/09/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F__%E8%87%AA%E5%88%B6%E7%AE%80%E5%8D%95U%E7%9B%98%E5%BC%95%E5%AF%BC%E7%A8%8B%E5%BA%8F/index.html">
<meta property="og:site_name" content="Cheney blog">
<meta property="og:description" content="用汇编语言编写一小段程序，如在屏幕上输出一个字符。（调用中断）增加键盘中断，可以对键盘上的动作进行响应（如敲入某字符X，屏幕能回显即可）。">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-05-09T00:22:00.000Z">
<meta property="article:modified_time" content="2022-04-05T13:14:30.011Z">
<meta property="article:author" content="Cheney">
<meta property="article:tag" content="算法">
<meta property="article:tag" content="C语言">
<meta name="twitter:card" content="summary_large_image">
  
  
  <title>自制简单U盘引导程序.md - Cheney blog</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css" />
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hint.css@2/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10/styles/github-gist.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css" />
  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"cheney822.gitee.io","root":"/","version":"1.8.14","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":1},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 5.4.1"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Cheney Blog</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('https://imgbed.cheney.cc/Blog_config/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="自制简单U盘引导程序.md">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2021-05-09 08:22" pubdate>
        2021年5月9日 早上
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      2.7k 字
    </span>
  

  
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      14 分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">自制简单U盘引导程序.md</h1>
            
            <div class="markdown-body">
              <h2 id="零基础如何编写并运行一个汇编程序-？"><a href="#零基础如何编写并运行一个汇编程序-？" class="headerlink" title="零基础如何编写并运行一个汇编程序 ？"></a>零基础如何编写并运行一个汇编程序 ？</h2><p>这里涉及到两个概念：汇编器和链接器</p>
<blockquote>
<p>汇编器（assembler）的作用是将用汇编语言编写的源程序转换成二进制形式的目标代码。Linux 平台的标准汇编器是 GAS，它是 GCC所依赖的后台汇编工具，通常包含在 binutils 软件包中。GAS 使用标准的 AT&amp;T 汇编语法，可以用来汇编用 AT&amp;T格式编写的程序：</p>
<p>由汇编器产生的目标代码是不能直接在计算机上运行的，它必须经过链接器的处理才能生成可执行代码。链接器通常用来将多个目标代码连接成一个可执行代码，这样可以先将整个程序分成几个模块来单独开发，然后才将它们组合(链接)成一个应用程序。Linux 使用 ld 作为标准的链接程序，它同样也包含在 binutils 软件包中。汇编程序在成功通过 GAS 或 NASM 的编译并生成目标代码后，就可以使用 ld 将其链接成可执行程序了：</p>
</blockquote>
<h4 id="准备工作：安装gcc-as86-ld86"><a href="#准备工作：安装gcc-as86-ld86" class="headerlink" title="准备工作：安装gcc,as86,ld86"></a>准备工作：安装gcc,as86,ld86</h4><p>gcc用于编译.c的程序，该程序用于将数据写入到U盘；<br>as86和ld86用于汇编和链接intel汇编语法下的汇编程序，该程序会写入数据到计算机的显示缓冲区，计算机会立即显示缓冲区的内容。<br>安装方法：</p>
<blockquote>
<p>sudo apt-get install gcc bin86</p>
</blockquote>
<h3 id="编写并运行一个汇编程序步骤："><a href="#编写并运行一个汇编程序步骤：" class="headerlink" title="编写并运行一个汇编程序步骤："></a>编写并运行一个汇编程序步骤：</h3><ul>
<li>1.<code>vim hello.s</code> 创建一个.s的文件</li>
<li>2.编写hello.s 的内容</li>
<li>3.编译：<code>as -o hello.o hello.s</code></li>
<li>4.链接：<code>ld -s -o hello hello.o</code></li>
<li>5.执行：<code>./hello</code></li>
</ul>
<p>这里给出一<code>在这里插入代码片</code>个简单程序hello world的汇编源代码：</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><div class="code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></div></td><td class="code"><pre><code class="hljs cpp"><span class="hljs-meta">#hello.s </span><br>.data                    <br>        msg : .string <span class="hljs-string">&quot;Hello, world!\\n&quot;</span> <br>        len = . - msg                   <br>.text                    <br>.global _start           <br>         <br>_start:                  <br>        movl $len, %edx  <br>        movl $msg, %ecx  <br>        movl $<span class="hljs-number">1</span>, %ebx   <br>        movl $<span class="hljs-number">4</span>, %eax    <br>        <span class="hljs-type">int</span>  $<span class="hljs-number">0x80</span>       <br>                                 <br>        movl $<span class="hljs-number">0</span>,%ebx     <br>        movl $<span class="hljs-number">1</span>,%eax     <br>        <span class="hljs-type">int</span>  $<span class="hljs-number">0x80</span>       <br><br></code></pre></td></tr></table></figure>

<h2 id="题目描述"><a href="#题目描述" class="headerlink" title="题目描述"></a>题目描述</h2><ul>
<li>1、用汇编语言编写一小段程序，如在屏幕上输出一个字符。（调用中断）</li>
<li>2、利用命令或winhex等工具将编译好的二进制程序写入U盘的主引导记录</li>
<li>3、开机，选择U盘启动，观察实验效果。</li>
<li>4、进一步地，丰富前述程序的功能，如增加键盘中断，可以对键盘上的动作进行响应（如敲入某字符X，屏幕能回显即可）。</li>
<li>5、再次写入引导扇区，观察实验效果</li>
</ul>
<p>下面是题目需要用到的一个小程序，屏幕输出按下的键盘：</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><code class="hljs cpp">NAME TURN<br>DSEG SEGMENT<br>A DB <span class="hljs-string">&#x27;PLEASE INPUT (a~z):&#x27;</span>,<span class="hljs-string">&#x27;$&#x27;</span><br>B DB <span class="hljs-number">0</span>AH,<span class="hljs-number">0</span>DH,<span class="hljs-string">&#x27;$&#x27;</span><br>DSEG ENDS<br>SSEG SEGMENT STACK<br>DB <span class="hljs-number">90</span><span class="hljs-function">H <span class="hljs-title">DUP</span><span class="hljs-params">(?)</span></span><br><span class="hljs-function">SSEG ENDS</span><br><span class="hljs-function">CSEG SEGMENT</span><br><span class="hljs-function">ASSUME CS:CSEG,DS:DSEG,SS:SSEG</span><br><span class="hljs-function">START:</span><br><span class="hljs-function">MOV AX,DSEG</span><br><span class="hljs-function">MOV DS,AX</span><br><span class="hljs-function"></span><br><span class="hljs-function">MOV DX,OFFSET A///提示输入</span><br><span class="hljs-function">MOV AH,<span class="hljs-number">09</span>H</span><br><span class="hljs-function">INT <span class="hljs-number">21</span>H</span><br><span class="hljs-function"></span><br><span class="hljs-function">MOV AH,<span class="hljs-number">01</span>H</span><br><span class="hljs-function">INT <span class="hljs-number">21</span>H</span><br><span class="hljs-function">MOV BL,AL</span><br><span class="hljs-function">SUB BL,<span class="hljs-number">20</span>H///转换</span><br><span class="hljs-function"></span><br><span class="hljs-function">MOV DX,OFFSET B</span><br><span class="hljs-function">MOV AH,<span class="hljs-number">09</span>H</span><br><span class="hljs-function">INT <span class="hljs-number">21</span>H</span><br><span class="hljs-function"></span><br><span class="hljs-function">MOV DL,BL</span><br><span class="hljs-function">MOV AH,<span class="hljs-number">02</span></span><br><span class="hljs-function">INT <span class="hljs-number">21</span>H//输出</span><br><span class="hljs-function"></span><br><span class="hljs-function">MOV AH,<span class="hljs-number">4</span>CH</span><br><span class="hljs-function">INT <span class="hljs-number">21</span>H/////结束</span><br><span class="hljs-function">CSEG ENDS</span><br><span class="hljs-function">END START </span><br></code></pre></td></tr></table></figure>

<h2 id="步骤"><a href="#步骤" class="headerlink" title="步骤"></a>步骤</h2><h4 id="编写能够在屏幕显示字符的汇编程序"><a href="#编写能够在屏幕显示字符的汇编程序" class="headerlink" title="编写能够在屏幕显示字符的汇编程序"></a>编写能够在屏幕显示字符的汇编程序</h4><p><code>vim bootsetc.s</code></p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs cpp">entry start<br>start:<br>mov ax,#<span class="hljs-number">0xb800</span><br>mov ds,ax<br>mov byte[<span class="hljs-number">0</span>],#<span class="hljs-number">0x4c</span><br>mov byte[<span class="hljs-number">1</span>],#<span class="hljs-number">0x1f</span><br>hlt<br></code></pre></td></tr></table></figure>
<p>　执行命令</p>
<blockquote>
<p>as86 -o bootsect.o bootsect.s 　　<br>ld86 -o bootsect bootsect.o</p>
</blockquote>
<p>　　生成可执行文件bootsect。 </p>
<h4 id="编写可将数据写入U盘启动扇区的程序"><a href="#编写可将数据写入U盘启动扇区的程序" class="headerlink" title="编写可将数据写入U盘启动扇区的程序"></a>编写可将数据写入U盘启动扇区的程序</h4><p><code>vim write-mbr.c</code></p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><code class="hljs cpp"><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&lt;fcntl.h&gt;</span></span><br><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&lt;stdio.h&gt;</span></span><br><span class="hljs-function"><span class="hljs-type">int</span> <span class="hljs-title">main</span><span class="hljs-params">(<span class="hljs-type">int</span> argc,<span class="hljs-type">char</span>*argv[])</span></span>&#123;<br>   	<span class="hljs-type">int</span> dev_flag,file_flag;<br>  	<span class="hljs-type">unsigned</span> <span class="hljs-type">char</span> buffer[<span class="hljs-number">512</span>];<br>	file_flag = <span class="hljs-built_in">open</span>(<span class="hljs-string">&quot;./bootsect&quot;</span>,O_RDONLY);<br>	<span class="hljs-keyword">if</span>(file_flag == <span class="hljs-number">-1</span>)&#123;<br>		<span class="hljs-built_in">perror</span>(<span class="hljs-string">&quot;failed to read file boot&quot;</span>);<br>	<span class="hljs-keyword">return</span> <span class="hljs-number">-1</span>;<br>&#125;<br>	<span class="hljs-built_in">read</span>(file_flag,buffer,<span class="hljs-number">510</span>);<br>	<span class="hljs-built_in">close</span>(file_flag);<br>	buffer[<span class="hljs-number">510</span>] =<span class="hljs-number">0x55</span>;<br>	buffer[<span class="hljs-number">511</span>] =<span class="hljs-number">0xaa</span>;<br>	dev_flag = <span class="hljs-built_in">open</span>(<span class="hljs-string">&quot;/dev/sda&quot;</span>,O_RDWR);<br>	<span class="hljs-keyword">if</span>(dev_flag == <span class="hljs-number">-1</span>)&#123;<br>		<span class="hljs-built_in">perror</span>(<span class="hljs-string">&quot;failed to open device /dev/sda&quot;</span>);<br>		<span class="hljs-keyword">return</span> <span class="hljs-number">-1</span>;<br>	&#125;<br>	<span class="hljs-built_in">write</span>(dev_flag,buffer,<span class="hljs-number">512</span>);<br>	<span class="hljs-built_in">close</span>(dev_flag);<br>	<span class="hljs-built_in">puts</span>(<span class="hljs-string">&quot;successful.&quot;</span>);<br><span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>&#125;<br></code></pre></td></tr></table></figure>
<p>执行命令
　　</p>
<blockquote>
<p>gcc -o write-mbr write-mbr.c</p>
</blockquote>
<h4 id="将U盘接入电脑，挂载到linux上"><a href="#将U盘接入电脑，挂载到linux上" class="headerlink" title="将U盘接入电脑，挂载到linux上"></a>将U盘接入电脑，挂载到linux上</h4><p>首先用命令 <code>sudo fdisk -l</code> 可以通过容量找到对应U盘的设备名称。<br>然后用命令 <code>sudo mount /dev/sda /mnt/flash</code>将U盘挂载到flash，注意该命令需要flash目录存在，不存在则要创建：<br><code>cd /mnt &amp;&amp; sudo mkdir flash</code>。<br>最后执行 <code>./write-mbr</code> ,shell返回successful，说明写入成功。</p>
<h4 id="卸载设备，将U盘插入一台电脑，并通过BIOS将启动项改为U盘优先。开机便可一看到一个蓝底白色的L字符。"><a href="#卸载设备，将U盘插入一台电脑，并通过BIOS将启动项改为U盘优先。开机便可一看到一个蓝底白色的L字符。" class="headerlink" title="卸载设备，将U盘插入一台电脑，并通过BIOS将启动项改为U盘优先。开机便可一看到一个蓝底白色的L字符。"></a>卸载设备，将U盘插入一台电脑，并通过BIOS将启动项改为U盘优先。开机便可一看到一个蓝底白色的L字符。</h4><h4 id="注意"><a href="#注意" class="headerlink" title="注意"></a>注意</h4><p>1)U盘在第二次插回linux主机时，会出现挂载失败的现象，原因可能是由于写入了512个字节的数据破坏了U盘关于分区，文件系统信息的记录，因此目前的解决办法就是重新格式化U盘，命令为 mkfs.vfat /dev/sda。格式化完成后挂载成功，即可在此写入程序。<br>2)每次都需要重新格式化U盘，然后挂载U盘，编译好几个文件，因此考虑写一个shell脚本一次性完成数据的写入任务。</p>
<h2 id="运行结果"><a href="#运行结果" class="headerlink" title="运行结果"></a>运行结果</h2>
            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/categories/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/">操作系统</a>
                    
                  </div>
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/%E7%AE%97%E6%B3%95/">算法</a>
                    
                      <a class="hover-with-bg" href="/tags/C%E8%AF%AD%E8%A8%80/">C语言</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2021/05/10/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F__%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E5%A4%8D%E4%B9%A0%E7%AC%94%E8%AE%B0/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">操作系统复习笔记</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2021/05/09/%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86__%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%A4%8D%E4%B9%A0%E6%80%BB%E7%BB%93%EF%BC%88%E7%B2%BE%E5%8D%8E%E7%89%88%EF%BC%89/">
                        <span class="hidden-mobile">编译原理复习总结（精华版）</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://cheney822.gitee.io/" target="_blank" rel="nofollow noopener"><span>备用网址</span></a> 
  </div>
  

  
  <!-- 备案信息 -->
  <div class="beian">
    <span>
      <a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
        皖ICP备2022002876号-1
      </a>
    </span>
    
  </div>


  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  <script  src="/js/local-search.js" ></script>



  
    <script  src="/js/img-lazyload.js" ></script>
  



  



  
    <script  src="https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js" ></script>
  
  
    <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js" ></script>
  






  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
        typing(title);
      
    })(window, document);
  </script>















<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
